package controller;

import com.jfinal.core.ActionKey;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

/**
 * Created by Administrator on 2018/5/16 0016.
 */
public class RegController extends Controller {
    @ActionKey("/regsist")
    public void regsist(){

        render("../reg.html");

    }
    @ActionKey("/regsister")
    public void regsister(){



        Record user=new Record().set("username",getPara("username")).set("password",getPara("pass")).
                set("nickname",getPara("nickname")).set("email",getPara("email"));
        Db.save("user",user);


        renderFreeMarker("../login.html");
    }
}
